package com.yeyks.common.utils.apputil.enums;

/**
 * 结算状态集合
 * @author Administrator
 */
public enum FinanceStatusEnum {
    /**
     *  状态，1申请结算中，2审核通过，3转账中，4打款成功，5打款失败，6已拒绝
     */
    WAIT("1","申请结算中"),
    PASS("2","审核通过"),
    REJECT("6","已拒绝")
    ;

    /**
     * code
     */
    private String code;

    /**
     * msg
     */
    private String msg;

    FinanceStatusEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * 根据 code值获取msg
     * @param code code值
     * @return
     */
    public static String getMsgByCode(String code){
        for(FinanceStatusEnum financeStatusEnum: FinanceStatusEnum.values()){
            if(code.equals(financeStatusEnum.getCode())){
                return financeStatusEnum.getMsg();
            }
        }
        return  null;
    }
}
